<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>事件绑定</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<h1>{{number}}</h1>
			<input type="text" v-model.lazy="number">
			<button v-on:click="addHandleFun">单击+1</button>
			<input type="text" v-model="counter">
			<h6>{{counter}}</h6>
		</div>
		
		<script>
		  let app=new Vue({
			  el:"#app",
			  data:{
				  number:1,
				  counter:1
			  },
			  //methods指定事件处理方法，在模板页面中通过v-on:事件名来进行调用
			  methods:{
				  addHandleFun:function(){
					  console.log("addHandleFun被调用");
					  this.number++;
				  }
			  }
			  
		  });	
		</script>
	</body>
</html>
